package com.easysoft.commons.utils;

public class RedisUtils {

	private RedisUtils() {
	}

	/**
	 * 获取Redis缓存主键
	 * 
	 * @param keys
	 *            缓存键中不能包含英文的':'
	 * @return
	 */
	public static String getKey(Object... keys) {

		StringBuffer sb = new StringBuffer();

		String key = null;
		for (int i = 0; i < keys.length; i++) {
			if (keys[i] != null) {
				key = String.valueOf(keys[i]);

				if (key.length() > 0) {
					sb.append(keys[i]);
					sb.append(':');
				}

			}
		}

		sb.deleteCharAt(sb.length()-1);

		return sb.toString();
	}
}
